using System;
using System.Collections.Generic;

namespace Microsoft.SqlServer.Management.SqlManagerUI
{
	public class DatabasesComparer : IComparer<DatabaseEntity>
	{
		public int Compare(DatabaseEntity x, DatabaseEntity y)
		{
			if (x == null)
			{
				return 0;
			}
			if (y == null)
			{
				return 0;
			}
			int num = x.DatabaseName.Length.CompareTo(y.DatabaseName.Length);
			if (num == 0)
			{
				num = x.DatabaseName.CompareTo(y.DatabaseName);
			}
			return num;
		}
	}
}
